package com.qiuhui.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName: Redirect
 * @Description: TODO
 * @author: tian
 * @date: 2021/3/22  5:08 下午
 */
@Controller
public class Redirect {
    @RequestMapping("/rsm/t1")
    public String test1() {
        // 转发
        return "user";
    }

    @RequestMapping("/rsm/t2")
    public String test2() {
        // 转发，地址不变 http://localhost:8080/rsm/t2
        return "forward:/index.jsp";
    }

    @RequestMapping("/rsm/t3")
    public String test3() {
        // 重定向，地址为http://localhost:8080/index.jsp
        return "redirect:/index.jsp";
    }
}
